package top.korori.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import top.korori.common.model.PageData;
import top.korori.entity.SysOptLog;
import top.korori.entity.bo.SysOptLogBo;
import top.korori.entity.vo.SysOptLogVo;
import top.korori.mapper.SysOptLogMapper;
import top.korori.service.SysOptLogService;

/**
 * 
 * 操作日志 服务实现类
 * 
 *
 * @author korori
 * @since
 */
@Service
public class SysOptLogServiceImpl extends ServiceImpl<SysOptLogMapper, SysOptLog> implements SysOptLogService {


    @Override
    public PageData<SysOptLogVo> list(SysOptLogBo sysOptLogBo) {
        System.out.println(sysOptLogBo.getPageNum());
        IPage<SysOptLogVo> page = new Page<>(sysOptLogBo.getPageNum(),sysOptLogBo.getPageSize());
        IPage<SysOptLogVo> sysOptLogIPage = baseMapper.list(page,sysOptLogBo);
        PageData<SysOptLogVo> pageData = new PageData<>();
        pageData.setList(sysOptLogIPage.getRecords());
        pageData.setTotal(sysOptLogIPage.getTotal());
        return pageData;
    }

    @Override
    public SysOptLogVo get(Long optLogId) {
        return baseMapper.getById(optLogId);
    }
}





















